﻿using UnityEngine;

public class SnakeGrid : Grid
{
    public string body;
    Texture s1 = GameManager.gamemanager.snakebody1;
    Texture s2 = GameManager.gamemanager.snakebody2;
    public override void Showme()
    {
        if (body == "1")
        {
            GUI.Box(new Rect(ix * isize + iwidth, iy * isize + iwidth, isize, isize), s1);
        }
        else 
        {
            GUI.Box(new Rect(ix * isize + iwidth, iy * isize + iwidth, isize, isize), s2);
        }
    }

    public override bool isDead
    {
        get
        {
            if (this == GameManager.gamemanager.lSnakeGrid1[GameManager.gamemanager.lSnakeGrid1.Count - 1])
            {
                return false;
            }
            return true;
        }
    }

    public void ShowHead(Texture head) 
    {
        GUI.Box(new Rect(ix * isize + iwidth, iy * isize + iwidth, isize, isize), head);
    }
}
